<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      header {
        width: 375px;
        height: 50px;
        background-color: #e54847;
        text-align: center;
        line-height: 50px;
        color: #fff;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <!-- <my-header title="猫眼电影"></my-header>
      <br />
      <my-header title="这个杀手不太冷静"></my-header> -->
      <my-header>猫眼电影</my-header>
      <br />
      <my-header>这个杀手不太冷静</my-header>
    </div>

    <script src="../Vue.js"></script>
    <script>
      // const MyHeader = {
      //   props: ["title"],
      //   template: `
      //     <header>{{ title }}</header>
      //   `,
      // };

      const MyHeader = {
        template: `
          <header><slot></slot></header>
        `,
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          MyHeader,
        },
      });
    </script>
  </body>
</html>
